package com.upay.android.domain.payment;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

public class PaymentList<T extends PaymentDetail> implements Serializable {

	/* ---- Constants ---- */
	private static final long serialVersionUID = 201402241230L;

	
	/* ---- Instance Variables ----*/
	public List<T> payments = null;
	public T selectedPayment = null;
	public BigDecimal transactionValue = null;

	/* ---- Constructors ---- */
	
	public PaymentList() {
		super();		
	}
	
	public PaymentList(List<T> payments) {
		this.payments = payments;
		this.transactionValue = new BigDecimal(0);
	}

	/* ---- Business Methods ----*/
	
	public boolean add(T payment) {
		return this.payments.add(payment);
	}
	
	public T get(int position) {
		return payments.get(position);
	}
	
	/* ---- Getters and Setters ----*/
	
	public T getSelectedPayment() {
		return selectedPayment;
	}

	public void setSelectedPayment(T selectedPayment) {
		this.selectedPayment = selectedPayment;
	}

	public List<T> getPayments() {
		return payments;
	}

	public void setPayments(List<T> payments) {
		this.payments = payments;
	}

	public BigDecimal getTransactionValue() {
		return transactionValue;
	}

	public void setTransactionValue(BigDecimal transactionValue) {
		this.transactionValue = transactionValue;
	}

}
